package yf.mall.vo.down;


import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.*;
import java.io.Serializable;



import yf.mall.entity.MaterialEntity;
import yf.mall.vo.MaterialVo;

                                    import yf.mall.enums.MaterialStatusEnum;

/**
 * 爆款素材实体
 * 表名 material
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Sat Oct 17 14:55:42 CST 2020
 */
@Data
public class MaterialDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

                        //
            @ExcelProperty("")
            private Long id;
        
                        //店铺id
            @ExcelProperty("店铺id")
            private Long shopId;
        
                        //发布用户id
            @ExcelProperty("发布用户id")
            private Long userId;
        
                        //产品id
            @ExcelProperty("产品id")
            private Long goodsId;
        
                        //产品名
            @ExcelProperty("产品名")
            private String goodsName;
        
                        //素材内容
            @ExcelProperty("素材内容")
            private String content;
        
                        //IMG-素材图
            @ExcelProperty("IMG-素材图")
            private String img;
        
                        //发布时间
            @ExcelProperty("发布时间")
            private Date createTime;
        
                        //ENUM-状态:"NO-未通过","AUDIT-待审核","YES-通过"
            @ExcelIgnore
            private Integer status;
                        @ExcelProperty("状态")
            private String statusStr;
        
    
    public MaterialDown() {

    }

    public MaterialDown(MaterialVo vo) {
        MaterialEntity entity = vo.getEntity();
                                    this.setId(entity.getId());
            
                                    this.setShopId(entity.getShopId());
            
                                    this.setUserId(entity.getUserId());
            
                                    this.setGoodsId(entity.getGoodsId());
            
                                    this.setGoodsName(entity.getGoodsName());
            
                                    this.setContent(entity.getContent());
            
                                    this.setImg(entity.getImg());
            
                                    this.setCreateTime(entity.getCreateTime());
            
                                    this.setStatus(entity.getStatus());
                if(entity.getStatus()!=null){
                    this.setStatusStr( MaterialStatusEnum.indexOf(entity.getStatus()));
                }
            
            }


}
